﻿using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
namespace GX
{
    public delegate void PoolDelegate(object item,bool isCreateOrDestroy);
    public interface IPoolable
    {
        void OnReuse(bool isNew);
        void OnRecycle(bool isDestroy);
    }
    public interface IObjectPool
    {
        int capacity { get; set; }
        int activeCount { get; }
        int deactiveCount { get; }
        int totalCount { get; }
        bool enabled { get; }
        PoolDelegate onGet { set; }
        PoolDelegate onRelease { set; }
        void Put(object item);
        bool Get(out object item);
        object Get();
         void Release(object item);
        void GC();
    }
    public interface IPoolManager:IService
    {
        int defaultCapacity { get; set; }
        bool Get(int typeHashCode, out object item);
        object Get(Type type);
        void Release(object item);
        void SetCapacity(int typeHashCode, int capacity);
        void GC();
    }
}